#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long LL;

// 观察发现右上角的距离一直是4k^2
int main()
{
    LL x, y; 
    cin >> x >> y;
    LL k = max(abs(x), abs(y));
    if(x >= y) cout << 4 * k * k + abs(x - k) + abs(y - k) << endl;
    else cout << 4 * k * k - abs(x - k) - abs(y - k) << endl;
    return 0;
}